<?php

/**
 * Created by PhpStorm.
 * User: DELL
 * Date: 7/8/14
 * Time: 8:51 AM
 */
class GetEbayCommand extends CConsoleCommand {
    public function run($args) {

        $url = "http://deals.ebay.com/";
        $results = HSCommon::handleSaveEbay($url);
        //send deals on home page
        HSCommon::sendEbayEmail($results);

        //send all deals

        $url_tech = "http://deals.ebay.com/category/?moduleId=5000017457&debug=3&mredirect&cc=daily";
        $results_tech = HSCommon::handleSaveEbay($url_tech);

        $url_fashion = "http://deals.ebay.com/category/?moduleId=5000017794&debug=3&mredirect&cc=daily";
        $results_fashion = HSCommon::handleSaveEbay($url_fashion);
        $total = array_merge($results_tech, $results_fashion);

        $url_home = "http://deals.ebay.com/category/?moduleId=5000017761&debug=3&mredirect&cc=daily";
        $results_home = HSCommon::handleSaveEbay($url_home);
        $total = array_merge($total, $results_home);

        $url_sony = "http://deals.ebay.com/category/?moduleId=5000017800&debug=3&mredirect&cc=daily";
        $results_sony = HSCommon::handleSaveEbay($url_sony);
        $total = array_merge($total, $results_sony);

        $url_auto = "http://deals.ebay.com/category/?moduleId=5000017798&debug=3&mredirect&cc=daily";
        $results_auto = HSCommon::handleSaveEbay($url_auto);
        $total = array_merge($total, $results_auto);

        $url_computer = "http://deals.ebay.com/category/?moduleId=5000017803&debug=3&mredirect&cc=daily";
        $results_computer = HSCommon::handleSaveEbay($url_computer);
        $total = array_merge($total, $results_computer);

        $url_tablet = "http://deals.ebay.com/category/?moduleId=5000017803&debug=3&mredirect&cc=daily";
        $results_tablet = HSCommon::handleSaveEbay($url_tablet);
        $total = array_merge($total, $results_tablet);

        $url_phone = "http://deals.ebay.com/category/?moduleId=5000017807&debug=3&mredirect&cc=daily";
        $results_phone = HSCommon::handleSaveEbay($url_phone);
        $total = array_merge($total, $results_phone);

        $url_camera = "http://deals.ebay.com/category/?moduleId=5000017809&debug=3&mredirect&cc=daily";
        $results_camera = HSCommon::handleSaveEbay($url_camera);
        $total = array_merge($total, $results_camera);

        $url_handy = "http://deals.ebay.com/category/?moduleId=5000017799&debug=3&mredirect&cc=daily";
        $results_handy = HSCommon::handleSaveEbay($url_handy);
        $total = array_merge($total, $results_handy);

        $url_cooking = "http://deals.ebay.com/category/?moduleId=5000017762&debug=3&mredirect&cc=daily";
        $results_cooking = HSCommon::handleSaveEbay($url_cooking);
        $total = array_merge($total, $results_cooking);

        $url_baume = "http://deals.ebay.com/category/?moduleId=5000017774&debug=3&mredirect&cc=daily";
        $results_baume = HSCommon::handleSaveEbay($url_baume);
        $total = array_merge($total, $results_baume);

        $url_hot_brand = "http://deals.ebay.com/category/?moduleId=5000017796&debug=3&mredirect&cc=daily";
        $results_hot_brand = HSCommon::handleSaveEbay($url_hot_brand);
        $total = array_merge($total, $results_hot_brand);

        $url_jewelry = "http://deals.ebay.com/category/?moduleId=5000017815&debug=3&mredirect&cc=daily";
        $results_jewelry = HSCommon::handleSaveEbay($url_jewelry);
        $total = array_merge($total, $results_jewelry);

        $url_clothing = "http://deals.ebay.com/category/?moduleId=5000017797&debug=3&mredirect&cc=daily";
        $results_clothing = HSCommon::handleSaveEbay($url_clothing);
        $total = array_merge($total, $results_clothing);

        $url_game = "http://deals.ebay.com/category/?moduleId=5000017812&debug=3&mredirect&cc=daily";
        $results_game = HSCommon::handleSaveEbay($url_game);
        $total = array_merge($total, $results_game);

        $url_coin = "http://deals.ebay.com/category/?moduleId=5000017792&debug=3&mredirect&cc=daily";
        $results_coin = HSCommon::handleSaveEbay($url_coin);
        $total = array_merge($total, $results_coin);

        $url_tissot = "http://deals.ebay.com/category/?moduleId=5000017795&debug=3&mredirect&cc=daily";
        $results_tissot = HSCommon::handleSaveEbay($url_tissot);
        $total = array_merge($total, $results_tissot);

        HSCommon::sendEbayEmail($total);

    }
}